package com.wiscamp.ninechapters.panels.infrastructure.converters;


import com.wiscamp.ninechapters.panels.domain.entities.Permission;
import com.wiscamp.ninechapters.panels.infrastructure.po.PermissionPO;
import com.wiscamp.ninechapters.panels.infrastructure.views.PermissionView;
import org.mapstruct.*;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface PermissionConverter {
    PermissionConverter Instance = Mappers.getMapper(PermissionConverter.class);

    Permission toPermission(PermissionPO po);

    Permission toPermissionByView(PermissionView view);

    PermissionPO toPermissionPO(Permission entity);

    PermissionPO toPermissionPO(Permission entity, @MappingTarget PermissionPO po);

}
